#region Summary

// 
// Owner : JackieHan 
// 
// Solution : ResearchTest 
// 
// Project : Jackie.Research.Wcf.Rest.Service
// 
// File : EchoService.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : Echo Service
// 
// History : 
//			2011-05-10 10:34:00	    Create 
// 

#endregion

#region Using

using System;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using Jackie.Research.Wcf.Rest.Contracts;
using Jackie.Research.Wcf.Rest.Domain;

#endregion

namespace Jackie.Research.Wcf.Rest.Service
{
    /// <summary> 
    /// Echo Service
    /// </summary>
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class EchoService : IEchoService
    {
        [WebGet]
        public string EchoWithGet(string s)
        {
            return "You said " + s;
        }

        [WebInvoke(Method = "POST")]
        public string EchoWithPost(string s)
        {
            return "You said " + s;
        }

        [WebInvoke(Method = "POST")]
        public string EchoWithPostObject(EchoInfo info)
        {
            return "You said " + info.Message;
        }

        [WebInvoke(Method = "POST")]
        public EchoInfo EchoWithPostObjectReturnObject(EchoInfo info)
        {
            info.Message = "You said " + info.Message;
            return info;
        }
    }
}